package saci.util.xml;

import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

public class Marshaller {
	
	public void marshal(Object bean, Writer writer) throws IOException {
		XmlWriter xml = new XmlWriter(writer);
		xml.writeBean(bean);
	}
	
	public <T> T unmarshal(Reader reader, Class<T> type) throws IOException {
		XmlReader xml = new XmlReader(reader);
		return xml.fillBean(type);
	}
}
